﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWPF.DataBinding
{
    public class MvvmLightViewModel : ViewModelBase
    {
        public RelayCommand SaveCommand { get; set; }

        public MvvmLightViewModel()
        {
            Student_Name = "张三";

            SaveCommand = new RelayCommand(()=> {
                Student_Name = "李四";
            });
        }

        private string _student_Name;

        public string Student_Name
        {
            get { return _student_Name; }
            set
            {
                _student_Name = value;
                RaisePropertyChanged();
            }
        }
    }
}
